package com.mallcloud.mall.app.controller;

import com.mallcloud.mall.product.api.vo.AppSpuVO;
import com.mallcloud.mall.app.service.AppProductService;
import com.mallcloud.mall.common.core.util.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "商品分类管理")
@RestController
@RequiredArgsConstructor
@RequestMapping("/app/spu")
public class AppProductController {
    private final AppProductService appProductService;

    @ApiOperation("商品详情")
    @GetMapping("/prodInfo")
    @ApiImplicitParam(name = "id", value = "商品id")
    public R<AppSpuVO> prodInfo(@RequestParam("spuId") Long spuId) {
        return R.ok(appProductService.prodInfo(spuId));
    }


}
